package com.example.backend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.backend.entity.CollectionBooklet;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author 李月
 * @date 2022/5/10 19:02
 */
@Mapper
public interface CollectionBookletMapper extends BaseMapper<CollectionBooklet> {
    @Select("SELECT * FROM tb_collection_booklet WHERE new_booklet_id=#{bookletId}")
    CollectionBooklet getOldBooklet(@Param("bookletId") int bookletId);

    @Delete("DELETE FROM tb_collection_booklet WHERE new_booklet_id=#{bookletId}")
    void deleteCollectionBooklet(@Param("bookletId") int bookletId);
}
